package com.bosssoft.springcloud.service.impl;

import com.bosssoft.springcloud.dao.PaymentDao;
import com.bosssoft.springcloud.entities.Payment;
import com.bosssoft.springcloud.service.PaymentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PaymentServiceImpl implements PaymentService {
    @Resource
    private PaymentDao paymentDao;

    /***
     * 查询订单列表
     * @return 订单列表
     */
    @Override
    public List<Payment> getOrderList() {
        return paymentDao.getOrderList();
    }

    /***
     * 添加订单
     * @param payment 订单
     * @return
     */
    @Override
    public int create(Payment payment) {
        return paymentDao.create(payment);
    }

    /***
     * 根据订单号查询订单
     * @param id 订单号
     * @return 订单
     */
    @Override
    public Payment getPayentById(long id) {
        return paymentDao.getPayentById(id);
    }

    /***
     * 根据id删除订单
     * @param id
     */
    @Override
    public int removeById(long id) {
    return   paymentDao.removeById(id);
    }


}
